package com.xm;

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MatchGenerator;

public class VarType_LocalVar {

    public static void main(String[] args) {

        int a = 10; // 局部变量a的声明与初始化
        int b;  // 局部变量b的声明
        b = 20; //局部变量b的初始化

        System.out.println("a = " + a);
        System.out.println("b = " + b);

        // 使用之前不进行初始化，编译器会报错
        // int c;
        // System.out.println("c = " + c);


        VarType_LocalVar varTypeLocalVar = new VarType_LocalVar();
        varTypeLocalVar.pupAge();

    }

    public void pupAge(){
        int age = 0;
        age = age + 7;
        System.out.println("小狗的年龄是：" + age);

    }

    int aa;
}
